//
//  MusicItem.m
//  CLUBiN
//
//  Created by Stefan Ivanov on 1/13/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "MusicItem.h"

@implementation MusicItem

@synthesize song;
@synthesize artist;

//initialization method for creating an instance
- (id)initWithSong: (NSString*)s Artist: (NSString*)a
{
    self.song = s;
    self.artist = a;
    return self;
}

//below is the implementation of the two methods required by the NSCoding protocol
-(id) initWithCoder: (NSCoder*) coder {
    if (self == [super init]) {
        self.song = [[coder decodeObjectForKey:@"Song"] retain];
        self.artist = [[coder decodeObjectForKey:@"Artist"] retain];
    }
    return self;
}


-(void) encodeWithCoder: (NSCoder*) coder {
    [coder encodeObject:self.song forKey:@"Song"]; 
    [coder encodeObject:self.artist forKey:@"Artist"]; 
}

@end
